package com.dbpms.pj.sys.dao;

import com.dbpms.pj.sys.pojo.SysUser;
import com.dbpms.pj.sys.pojo.SysUserDept;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Author: Song Yu
 * @Date: 2020/10/20 16:46
 */
@Mapper
public interface SysUserDao {
    int getRowCount(String username);

    List<SysUserDept> findPageObjects(String username, Integer startIndex, Integer pageSize);

    @Update("update sys_users set valid=#{valid},modifiedUser=#{modifiedUser},modifiedTime=now() where id=#{id}")
    int updateValidById(Integer id, Integer valid,String modifiedUser);

    int insertObject(SysUser entity);

    SysUserDept findObjectById(Integer id);

    int updateObject(SysUser entity);

    @Select("select * from sys_users where username=#{username}")
    SysUser findUserByUsername(String username);

 }
